combobox: Use dispose instead of destroy
authorMatthias Clasen <mclasen@redhat.com>
Tue, 5 May 2020 20:47:10 +0000 (16:47 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 5 May 2020 22:23:53 +0000 (18:23 -0400)
The destroy vfunc is going away.

gtk/gtkcombobox.c

index 1edd1661fb15b1b5909c0d15c8568398def48cb5..266e1d1afe6e13dbbf0b7a6cdcdf3c7780468544 100644 (file)
@@ -205,7 +205,6 @@ static void     gtk_combo_box_cell_editable_init   (GtkCellEditableIface *iface)
 static void     gtk_combo_box_constructed          (GObject          *object);
 static void     gtk_combo_box_dispose              (GObject          *object);
 static void     gtk_combo_box_unmap                (GtkWidget        *widget);
-static void     gtk_combo_box_destroy              (GtkWidget        *widget);
 
 static void     gtk_combo_box_set_property         (GObject         *object,
                                                     guint            prop_id,
@@ -412,7 +411,6 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
   widget_class->measure = gtk_combo_box_measure;
   widget_class->size_allocate = gtk_combo_box_size_allocate;
   widget_class->unmap = gtk_combo_box_unmap;
-  widget_class->destroy = gtk_combo_box_destroy;
   widget_class->compute_expand = gtk_combo_box_compute_expand;
 
   object_class = (GObjectClass *)klass;
@@ -2285,42 +2283,6 @@ gtk_combo_box_unmap (GtkWidget *widget)
   GTK_WIDGET_CLASS (gtk_combo_box_parent_class)->unmap (widget);
 }
 
-static void
-gtk_combo_box_destroy (GtkWidget *widget)
-{
-  GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
-  GtkComboBoxPrivate *priv = gtk_combo_box_get_instance_private (combo_box);
-
-  if (priv->popup_idle_id > 0)
-    {
-      g_source_remove (priv->popup_idle_id);
-      priv->popup_idle_id = 0;
-    }
-
-  if (priv->box)
-    {
-      /* destroy things (unparent will kill the latest ref from us)
-       * last unref on button will destroy the arrow
-       */
-      gtk_widget_unparent (priv->box);
-      priv->box = NULL;
-      priv->button = NULL;
-      priv->arrow = NULL;
-      priv->child = NULL;
-      priv->cell_view = NULL;
-    }
-
-  if (priv->row_separator_destroy)
-    priv->row_separator_destroy (priv->row_separator_data);
-
-  priv->row_separator_func = NULL;
-  priv->row_separator_data = NULL;
-  priv->row_separator_destroy = NULL;
-
-  GTK_WIDGET_CLASS (gtk_combo_box_parent_class)->destroy (widget);
-  priv->cell_view = NULL;
-}
-
 static void
 gtk_combo_box_entry_contents_changed (GtkEntry *entry,
                                       gpointer  user_data)
@@ -2429,6 +2391,32 @@ gtk_combo_box_dispose (GObject* object)
   GtkComboBox *combo_box = GTK_COMBO_BOX (object);
   GtkComboBoxPrivate *priv = gtk_combo_box_get_instance_private (combo_box);
 
+  if (priv->popup_idle_id > 0)
+    {
+      g_source_remove (priv->popup_idle_id);
+      priv->popup_idle_id = 0;
+    }
+
+  if (priv->box)
+    {
+      /* destroy things (unparent will kill the latest ref from us)
+       * last unref on button will destroy the arrow
+       */
+      gtk_widget_unparent (priv->box);
+      priv->box = NULL;
+      priv->button = NULL;
+      priv->arrow = NULL;
+      priv->child = NULL;
+      priv->cell_view = NULL;
+    }
+
+  if (priv->row_separator_destroy)
+    priv->row_separator_destroy (priv->row_separator_data);
+
+  priv->row_separator_func = NULL;
+  priv->row_separator_data = NULL;
+  priv->row_separator_destroy = NULL;
+
   if (priv->popup_widget)
     {
       /* Stop menu destruction triggering toggle on a now-invalid button */